#ifndef MODELDATA_H
#define MODELDATA_H

#include <string>
#include <vector>

struct Point
{
	Point()
	{
		coords[0] = coords[1] = coords[2] = 0.0;
	}

	Point(const float x, const float y, const float z)
	{
		coords[0] = x;
		coords[1] = y;
		coords[2] = z;
	}

	float coords[3];
};

struct Triangle
{
	Triangle()
	{
		for(int i = 0; i != 3; ++i)
		{
			vertexIndices[i] = -1;
			normals[i] = texCoord[i] = Point(0.0, 0.0, 0.0);
		}
	}

	unsigned int vertexIndices[3];
	Point normals[3];
	Point texCoord[3];
	Point tangent;
};

struct Material
{
	Material()
		:shiness(0)
		,transparency(0.0)
	{
		for(int i = 0; i != 3; ++i)
		{
			ambient[i] = diffuse[i] = specular[i] = 0.0;
		}
	}

	float ambient[3];
	float diffuse[3];
	float specular[3];
	float shiness;
	float transparency;
	std::string texFileName;
	std::string bumpFileName;
};

struct Mesh
{
	Mesh()
		:matIndex(0)
	{}

	unsigned short matIndex;
	std::vector<Triangle> triangles;
};

struct ViewModel
{
	std::vector<Point> vertices;
	std::vector<Mesh> meshes;
	std::vector<Material> materials;
	std::vector<int> textures;
	std::vector<int> bumpTextures;
};

#endif // MODELDATA_H